<template>
	<view class="homePage">
		<!-- 套餐1 -->
		<view class="backgroundImage flex-columns" v-if="tabListNum==1">

			<view class="headformation flex-between">
				<view class="flex" @click="improveInformationFn">
					<!-- <image class="avater" src="../../static/会员卡管理端/组合 519.png" mode=""></image> -->
					<view style="margin-left: 10rpx; " class="flex-column-start">
						<view style="color: #fff;font-size: 32rpx;margin-bottom: 8rpx;">
							{{merchantInformation.name}}
						</view>
						<view style="color: rgb(255, 255, 255);">
							<text>账号：{{merchantInformation.phone}}</text>
						</view>
					</view>
				</view>
				<view class="membershipCode " @click="changePassword()">
					<image class="codeImage" src="../../static/会员卡管理端/Vector (2).png" mode=""></image>
					<view style="color: #fff;">
						修改密码
					</view>
				</view>
			</view>
			<!-- 数据明细 -->
			<view class="flex-around dataDetails">
				<view class="flex-column" v-for="(item,i) in dataDetails" :key="i">
					<view class="margin-bottom_10rpx font-weight_bold" style="color: #fff;font-size: 36rpx;">
						{{totelName(item.number)}}
					</view>
					<view style="color: rgba(255, 255, 255, 0.84);font-size: 24rpx;">
						{{item.text}}
					</view>
				</view>

			</view>

		</view>
		<view class="conent">
			<view class="coreData">
				<view class=" flex-betweens">
					<view class="flex">
						<view class="line margin-right_16rpx">

						</view>

						<text class="font-weight_bold ">核心数据</text>
					</view>
					<text  @click="viewData()" style="color: rgb(129, 129, 129)"
						class="font-weight_bold font-size_20rpx">查看营收 ></text>
				</view>
				<!-- 订单状态 -->
				<view class="selectTime flex-align-center" >

					<view class="tab" v-for="(item, index) in orderStatusArr" :key="index">
						<view :class="[currentIndex == index ? 'active' : '']" @click="switchTimeTab(index,item)">
							{{ item.value }}
						</view>
					</view>
				</view>
				<!-- 数据核心 -->
				<view class="dataStatistics flex-wrap-justifyBetween" v-if="timeData!=null">
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.orderTurnover}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">商城营业额</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.orderWaitPay}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">待支付金额</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.orderTotalCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">商城订单(件)</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.orderEndCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">已完成(件)</text>
						</view>
					</view>

					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.orderPayCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">待付款(件)</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.ordershouCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">待收货(件)</text>
						</view>
					</view>

					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.userCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">新增客户</text>
						</view>
					</view>

					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.goodsCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">上架商品</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.packageCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">上架套餐</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.packageOrderCount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">套餐购买金额</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text>￥</text>
							<text style="font-size: 18px;font-weight: 700;">{{timeData.packageOrderAmount}}</text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);">套餐购买数</text>
						</view>
					</view>
					<view class="flex-column padding30 width33">
						<view style="color: rgb(255, 0, 0);">
							<text></text>
							<text style="font-size: 18px;font-weight: 700;"></text>
						</view>
						<view class="">

							<text style="color: rgb(153, 153, 153);"></text>
						</view>
					</view>
				</view>

			</view>
			<!-- 套餐卡配置 -->
			<view class="packageCardConfiguration flex-columns" >
				<!-- 套餐卡配置 -->
				<view class=" flex-start-center">
					<view class="line margin-right_16rpx">

					</view>

					<text class="font-weight_bold font-size_30rpx">套餐卡配置</text>

				</view>
				<view class="flex-wrap-justifyBetween" style="margin-top: 50rpx;">
					<block v-for="(item, i) in menuNavigationList" :key="i">
						<view class="flex-column infoBox" @click="packageConfigFn(item)">
							<image class="avaterIcon" :src="item.img" mode=""></image>
							<view class="rightContent">
								<view class="authorizationTitle">{{ item.text }}</view>
							</view>
						</view>

					</block>
				</view>
			</view>
			<!-- 商城配置 -->
			<view class="packageCardConfiguration flex-columns" >
				<!-- 商城配置 -->
				<view class=" flex-between">
					<view class="flex-start-center">
						<view class="line margin-right_16rpx">

						</view>

						<text class="font-weight_bold font-size_30rpx">商城配置</text>
					</view>
					<view class="flex" @click="integralRatio()">
						<text>设置商品积分比例</text>
						<uni-icons type="right" size="15"></uni-icons>
					</view>
				</view>
				<view class="flex-wrap-justifyBetween" style="margin-top: 50rpx;">
					<block v-for="(item, i) in shopNavigationList" :key="i">
						<view class="flex-column infoBox" @click="shopConfigFn(item)">
							<image class="avaterIcon" :src="item.img" mode=""></image>
							<view class="rightContent">
								<view class="authorizationTitle">{{ item.text }}</view>
							</view>
						</view>

					</block>
				</view>
			</view>
			<!-- 分销中心 -->
			<view class="packageCardConfiguration flex-columns" >

				<view class=" flex-start-center">
					<view class="line margin-right_16rpx">

					</view>

					<text class="font-weight_bold font-size_30rpx">分销中心</text>

				</view>
				<view class="flex-wrap-justifyBetween" style="margin-top: 50rpx;">
					<block v-for="(item, i) in distributionList" :key="i">
						<view class="flex-column infoBox" @click="distributionCenterFn(item)">
							<image class="avaterIcon" :src="item.img" mode=""></image>
							<view class="rightContent">
								<view class="authorizationTitle">{{ item.text }}</view>
							</view>
						</view>

					</block>
				</view>
			</view>
			<!-- 首页设置 -->
			<view class="packageCardConfiguration flex-columns" >

				<view class=" flex-start-center">
					<view class="line margin-right_16rpx">

					</view>

					<text class="font-weight_bold font-size_30rpx">首页设置</text>

				</view>
				<view class="flex-wrap-justifyBetween" style="margin-top: 50rpx;">
					<block v-for="(item, i) in indexList" :key="i">
						<view class="flex-column infoBox" @click="indexConfigFn(item)">
							<image class="avaterIcon" :src="item.img" mode=""></image>
							<view class="rightContent">
								<view class="authorizationTitle">{{ item.text }}</view>
							</view>
						</view>

					</block>
				</view>
			</view>
			<!-- 其他功能 -->
			<view class="packageCardConfiguration flex-columns">

				<view class=" flex-start">
					<view class="line margin-right_16rpx">

					</view>

					<text class="font-weight_bold font-size_30rpx">其他功能</text>

				</view>
				<view class="flex-wrap-justifyBetween" style="margin-top: 50rpx;">
					<block v-for="(item, i) in otherList" :key="i">
						<view class="flex-column infoBox" @click="otherFn(item)" >
							<image class="avaterIcon" :src="item.img" mode=""></image>
							<view class="rightContent">
								<view class="authorizationTitle">{{ item.text }}</view>
							</view>
						</view>

					</block>
				</view>
			</view>
		</view>
		<sunui-popup ref="myPackagePopup">
			<template v-slot:content>

				<view class="edit">

					<view>
						<uni-forms :rules="rulesWxForm" ref="formPsw" :modelValue="formPsw" label-position="top">

							<uni-forms-item label="修改后的密码" name="password" required labelWidth="180px">
								<uni-easyinput trim="all" v-model="formPsw.password" placeholder="请输入修改后的密码" />

							</uni-forms-item>
							<!-- 	<uni-forms-item label="扣除积分" name="integral" required labelWidth="180px">
								<uni-easyinput type='number' maxlength="11" trim="all" v-model="form.integral"
									placeholder="请输入积分" />
		
							</uni-forms-item> -->


							<view class=" flex-around">
								<view class="cancel flex" @click="cancel()">
									取消
								</view>
								<view class="sumbit-btn flex" @click="saveInfo('formPsw')">
									确定
								</view>
							</view>


						</uni-forms>
					</view>


				</view>

			</template>
		</sunui-popup>
		<!-- 输入框示例 -->
		<uni-popup ref="inputDialog" type="dialog">
			<uni-popup-dialog ref="inputClose" mode="input" title="积分比例设置"
				:value="form_integral.deduction_integral_ratio" placeholder=""
				@confirm="dialogInputConfirm"></uni-popup-dialog>

		</uni-popup>
		<term-picker :visable.sync="pickerVisable" :defaultDate="defaultDate" @confirm="confirm"></term-picker>
	</view>
</template>

<script>
	import moment from 'moment';
	import TabBar from '../../components/jinjie-tabbar/jinjie-tabbar.vue'

	export default {
		components: {
			TabBar,

		},
		props: {

			// 多模版table列表展示
			tabListNum: {
				type: Number,
				default: 1
			}
		},
		data() {
			const currentDate = this.getDate({
				format: true
			});
			return {
				timeData: null,
				defaultDate: [currentDate, currentDate],
				startDate: '',
				/* 筛选时间 start */
				pickerVisable: false,
				token: uni.getStorageSync('login').token,
				role_type: uni.getStorageSync('login').role_type,
				merchantInformation: uni.getStorageSync('login'),
				// 数据明细
				dataDetails: [{
						number: 388.00,
						text: '商城营业额(元)'
					},
					{
						number: 3.00,
						text: '套餐购买金额(元)'
					},
					{
						number: 18000,
						text: '员工(人)'
					},

				],
				orderStatusArr: [{
						value: '今日'
					},
					{
						value: '昨日'
					},
					{
						value: '近七天'
					},
					{
						value: '自定义'
					},

				],
				// 统计索引
				currentIndex: 0,

				// 商城配置
				shopNavigationList: [{
						img: '../../static/会员卡管理端/组合 525.png',
						text: '轮播图',

						url: '/pages/carouselManagement/carouselManagement'
					},
					{
						img: '../../static/会员卡管理端/组合 524.png',
						text: '商城分类',
						url: '/pages/classificationManagement/classificationManagement',

					},
					{
						img: '../../static/会员卡管理端/组合 523.png',
						text: '商城订单',

						url: '/pages/orderManagement/orderManagement'
					},
					{
						img: '../../static/会员卡管理端/组合 522.png',
						text: '商品列表',

						url: '/pages/productManagement/productList'
					},

				],
				menuNavigationList: [{
						img: '../../static/会员卡管理端/组合 518.png',
						text: '套餐卡管理',

						url: '/pages/packageManagement/packageManagement'
					},
					{
						img: '../../static/会员卡管理端/组合 519.png',
						text: '套餐卡列表',
						url: '/pages/packageManagement/packageList/packageList',

					},
					{
						img: '../../static/会员卡管理端/组合 520.png',
						text: '套餐卡订单 ',

						url: '/pages/packageManagement/packageCardRecord/packageCardRecord'
					},
					{
						img: '../../static/会员卡管理端/组合 521.png',
						text: '优惠券管理',

						url: '/pages/couponManagement/couponManagement'
					},

				],
				distributionList: [

					{
						img: '../../static/会员卡管理端/组合 528.png',
						text: '收益排行',

						url: '/pages/commissionRevenues/commissionRevenues'
					},
					{
						img: '../../static/会员卡管理端/组合 529.png',
						text: '提现设置',

						url: '/pages/withdrawalSettings/withdrawalSettings'
					},
					{
						img: '../../static/会员卡管理端/组合 530.png',
						text: '提现记录',
						url: '/pages/withdrawalSettings/withdrawalRecords/withdrawalRecords'
					},

				],
				indexList: [{
						img: '../../static/会员卡管理端/组合 524.png',
						text: '工具设置',

						url: '/pages/HomePageTool/HomePageTool'
					},
					{
						img: '../../static/会员卡管理端/组合 532.png',
						text: '广告图',
						url: '/pages/carouselManagement/carouselManagement',

					},
					{
						img: '../../static/会员卡管理端/组合 533.png',
						text: '首页模版',

						url: '/pages/selectTemplate/selectTemplate'
					},


				],
				otherList: [{
						img: '../../static/会员卡管理端/组合 537.png',
						text: '用户管理',

						url: '/pages/userManagement/userManagement'
					},
					{
						img: '../../static/会员卡管理端/组合 536.png',
						text: '员工管理',
						url: '/pages/myEmployees/myEmployees',

					},
					{
						img: '../../static/会员卡管理端/组合 535.png',
						text: '门店列表',

						url: '/pages/storeList/storeList'
					},
					// {
					// 	img: '../../static/会员卡管理端/组合 534.png',
					// 	text: '支付管理',

					// 	url: '/pages/paymentManagement/paymentManagement'
					// },
					{
						img: '../../static/会员卡管理端/组合 538.png',
						text: '支付配置',

						url: '/pages/paymentManagement/paymentConfiguration/paymentConfiguration'
					},
					{
						img: '../../static/会员卡管理端/组合 526.png',
						text: '会员权益',

						url: '/pages/memberPermission/memberPermission'
					},
					{
						img: '../../static/会员卡管理端/组合 526.png',
						text: '会员等级',

						url: '/pages/memberLevelSetting/memberLevelList'
					},
					{
						img: '../../static/会员卡管理端/组合 9138.png',
						text: '充值金额',

						url: '/pages/rechargeAmount/rechargeAmount'
					},
					{
						img: '../../static/会员卡管理端/微信图片_20240424110503.png',
						text: '打印机',

						url: '/pages/printer/printerList'
					},
					// {
					// 	img: '../../static/会员卡管理端/组合 539.png',
					// 	text: '收银台',

					// 	url: '/pages/cashierSystem/cashierSystem'
					// },

				],
				currentMoment: '',
				endMoment: '',
				form: {
					start_time: '',
					end_time: ""
				},
				form_integral: {
					deduction_integral_ratio: '',

				},

				formPsw: {
					password: ''
				},
				rulesWxForm: {
					password: {
						rules: [{
							required: true,
							errorMessage: '请输入修改后的密码'
						}]
					},

				},
			}
		},
		onInit() {
			//隐藏官方的tabBar

		

		},
		
		
		onLoad() {
   //            if( uni.getStorageSync('login').role_type==3){
			// 	console.log('App Launch')
			// 	console.log(uni.getStorageSync('login').role_type)
			// 	uni.setTabBarItem({
			// 		index: 3, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
			// 	uni.setTabBarItem({
			// 		index: 4, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
			// }
			
			// if( uni.getStorageSync('login').role_type==2){
			// 	console.log('App Launch')
			// 	console.log(uni.getStorageSync('login').role_type)
			// 	uni.setTabBarItem({
			// 		index: 0, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
			// 	uni.setTabBarItem({
			// 		index: 1, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
			// 	uni.setTabBarItem({
			// 		index: 3, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
			// 	uni.setTabBarItem({
			// 		index: 4, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
				
			// }
			// if( uni.getStorageSync('login').role_type==1){
			// 	console.log('App Launch')
			// 	console.log(uni.getStorageSync('login').role_type)
			// 	uni.setTabBarItem({
			// 		index: 2, // 假设“我的”在第二个位置
			// 		visible: false
				
			// 	});
				
			// }
			console.log('123131')
		},
		onShow() {
			
			console.log('123131')
			this.$at.releaseKey('submit');
		},

		mounted() {
			this.switchTimeTab(0, {
				value: '今日'
			})
		},
		computed: {
			totelName: function() {
				return function(num) {

					if (num >= 10000) {
						let remainder = num % 10000;
						let quotient = Math.floor(num / 10000);
						let decimal = Math.floor(remainder / 1000);
						return quotient + '.' + decimal + '万';
					} else {
						return num.toString();
					}
				};
			}
		},
		methods: {
			cancel() {
				this.$refs.myPackagePopup.close()
			},
			saveInfo(formName) {

				this.$refs[formName].validate((err, formData) => {
					// 如果校验成功 ，err 返回 null
					if (err) {
						console.log(err, formData)
						return
					} else {

						console.log(this.form)
						// 需要判断输入的金额是否大于现在的金额

						if (!this.formPsw.password) {
							this.$sun.toast('请输入修改后的密码', 'none')
							return
						} else {
							this.$at.uniDoFunc({
								key: 'submit',
								success: async () => {
									this.$at.lockKey('submit');
									// 登录 需要进行判断当前账号密码 和账号归属店铺及角色是否又选择


									console.log((this.form))

									const res = await this.$http.post({
										url: this.$api.updateAccount,
										data: {

											...this.formPsw
										},
										headers: {
											'Authorization': `Bearer ${this.token}`
										}

									})
									console.log(res)
									if (res.code == 0) {



										// 跳转到登录页面
										this.$at.releaseKey('submit');
										this.$sun.toast(res.msg, 'none')

										setTimeout(() => {
											this.$refs.myPackagePopup.close()
											this.$sun.navRe('/pages/loginPage/index')

										}, 500)
									} else {
										this.$at.releaseKey('submit');
										this.$sun.toast(res.msg, 'none')
									}

								}
							});
						}


					}

				}).then(async res => {



				})

			},
			changePassword() {
				this.$refs.myPackagePopup.show({
					style: 'background-color:#fff;width:600rpx;height:400rpx;border-radius:10rpx;padding:20rpx;overflow: scroll;',
					bottomClose: true,
					shadeClose: true,
					topclose: true
				});
			},
			viewData() {
				this.$sun.navGo('/pages/revenueRecords/revenueRecords')
			},
			openPicker() {
				this.pickerVisable = true;
			},
			// 设置积分比例
			async integralRatio() {

				const result = await this.$http.post({
					url: this.$api.getConfig,
					data: {


					},
					headers: {
						'Authorization': `Bearer ${this.token}`
					}

				})
				if (result.code == 0) {
					// 修改价格
					this.$refs.inputDialog.open()
					this.$sun.assignObject(this.form_integral, {
						...result.data
					})
					// this.$sun.toast(result.msg, 'none')

				} else {
					this.$sun.toast(result.msg, 'none')
				}

			},
			async dialogInputConfirm(e) {
				console.log(e)

				const result = await this.$http.post({
					url: this.$api.upConfig,
					data: {
						deduction_integral_ratio: e

					},
					headers: {
						'Authorization': `Bearer ${this.token}`
					}

				})
				if (result.code == 0) {
					this.$sun.toast(result.msg, 'none')

				} else {
					this.$sun.toast(result.msg, 'none')
				}
			},
			// 日期获取
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;

				return `${year}-${month}-${day}`;

			},
			confirm(e) {
				console.log('点击确定按钮，返回当前选择的值', e); // ['2021-06-01', '2021-07-01']
				console.log('打印所有的范围日期e', e);
				this.startDate = e[0];
				// this.startDate = e[0]+'-'+e[1];
				Object.assign(this.form, {
					start_time: e[0] + ' 00:00:00',
					end_time: e[1] + ' 23:59:59'
				});
				this.homeDataFn()


			},

			switchTimeTab(index, item) {
				console.log(index, item)
				console.log(index == 0 && item.value == '今日')
				this.currentIndex = index;

				if (index == 0 && item.value == '今日') {
					this.currentMoment = moment();
					this.currentMoment.startOf('day');

					const currentDate = this.currentMoment.format('YYYY-M-D HH:mm:ss');
					console.log(currentDate)
					this.form.start_time = currentDate

					this.endMoment = moment();

					// 获取当天的最后一秒
					this.endMoment.endOf('day');
					const endDate = this.endMoment.format('YYYY-M-D HH:mm:ss');
					console.log(endDate)
					this.form.end_time = endDate
					// 调接口
					this.homeDataFn()
				} else if (index == 1 && item.value == '昨日') {
					this.currentMoment = moment();
					this.currentMoment.startOf('day');
					const previousDate = this.currentMoment.subtract(1, 'days');
					const currentDate = previousDate.format('YYYY-M-D HH:mm:ss');
					console.log(currentDate)
					this.form.start_time = currentDate
					this.endMoment = moment();

					// 获取当天的最后一秒
					this.endMoment.endOf('day');
					const endDate = this.endMoment.subtract(1, 'days');
					const endDates = endDate.format('YYYY-M-D HH:mm:ss');
					console.log(endDates)
					this.form.end_time = endDates
					
					this.homeDataFn()
				} else if (index == 2 && item.value == '近七天') {
					this.currentMoment = moment();
					this.currentMoment.startOf('day');
					const previousDate = this.currentMoment.subtract(7, 'days');
					const currentDate = previousDate.format('YYYY-M-D HH:mm:ss');
					console.log(currentDate)
					this.form.start_time = currentDate
					this.endMoment = moment();

					// 获取当天的最后一秒
					
					this.endMoment.endOf('day');
					const endDate = this.endMoment.format('YYYY-M-D HH:mm:ss');
					// const endDate = this.endMoment.subtract(7, 'days');
					// const endDates = endDate.format('YYYY-M-D HH:mm:ss');
					console.log(endDate)
					this.form.end_time = endDate
					this.homeDataFn()
				} else {
					console.log('自定义')
					this.openPicker()
				}



			},
			async homeDataFn() {
				console.log(this.form)
				const result = await this.$http.post({
					url: this.$api.home,
					data: {
						...this.form

					},
					headers: {
						'Authorization': `Bearer ${this.token}`
					}

				})
				if (result.code == 0) {

					this.timeData = result.data
					this.dataDetails.forEach((item) => {
						switch (item.text) {
							case '商城营业额(元)':
								item.number = this.timeData.orderTurnover;
								break;
							case '套餐购买金额(元)':
								item.number = this.timeData.packageOrderCount;
								break;
							case '员工(人)':
								item.number = this.timeData.staffCount;
								break;
								// 可根据实际情况继续添加其他匹配条件
						}
					})
				} else {
					this.$sun.toast(result.msg, 'none')
				}
			},
			// 修改信息(资料)
			improveInformationFn() {
				uni.navigateTo({
					url: '/pages/improveInformation/improveInformation'
				});
			},
			// 套餐配置
			packageConfigFn(item) {

				uni.navigateTo({
					url: item.url
				});
			},
			// 商城配置
			shopConfigFn(item) {
				if (item.text == '商品列表') {
					uni.switchTab({
						url: item.url
					})
				} else {
					uni.navigateTo({
						url: item.url
					});
				}


			},
			// 分销中心
			distributionCenterFn(item) {
				uni.navigateTo({
					url: item.url
				});
			},
			// 首页配置
			indexConfigFn(item) {
				uni.navigateTo({
					url: item.url
				});
			},
			// 其他功能
			otherFn(item) {
				if (item.text == '员工管理') {
					uni.switchTab({
						url: item.url
					})
				} else {
					uni.navigateTo({
						url: item.url
					});
				}

			}


		}
	}
</script>
<style>
	page {
		background: #f6f6f6;
	}
</style>
<style lang="less" scoped>
	.edit {
		.cancel {
			width: 268rpx;
			height: 96rpx;
			box-sizing: border-box;
			border: 1px solid rgb(1, 95, 255);
			background: rgb(255, 255, 255);
			border-radius: 60rpx;
		}

		.modifySuperior {}

		.sumbit-btn {

			width: 268rpx;
			height: 96rpx;
			background: linear-gradient(135.00deg, rgb(1, 95, 255) 0%, rgb(0, 146, 255) 44.593%, rgb(1, 95, 255) 83.407%, rgb(250, 100, 25) 100%);


			height: 100rpx;
			color: #fff;
			border-radius: 60rpx;

			background-color: #1890FF;
		}

		.image {
			width: 88rpx;
			height: 88rpx;
			border-radius: 50%;
		}

		.inputIphone {

			height: 108rpx;
			padding: 34rpx;
			border-radius: 20rpx;

			background: rgb(246, 246, 246);
		}

		.verificationCode {
			width: 36rpx;
			height: 36rpx;
		}

		.iphones {
			position: relative;

			.verificationCodes {
				z-index: 999;
				position: absolute;
				right: 16rpx;
				top: 23rpx;
				text-align: center;
				width: 170rpx;
				height: 65rpx;
				line-height: 65rpx;
				border-radius: 100rpx;
				font-size: 20rpx;
				border-radius: 20rpx;

				background: rgb(28, 110, 255);
				color: #fff;
			}
		}



	}

	.homePage {
		.backgroundImage {
			padding: 36rpx 30rpx;
			background-image: url('../../static/会员卡管理端/6045b99a804a5_01.png');
			height: 300rpx;
			background-repeat: no-repeat;
			background-size: cover;

			.headformation {
				margin-bottom: 32rpx;

				.avater {
					width: 96rpx;
					height: 96rpx;
					margin-right: 15rpx;
				}

				.memberType {
					/* 矩形 1043 */
					color: rgb(255, 255, 255);
					font-family: 思源黑体;
					font-size: 24rpx;
					font-weight: 400;
					border-radius: 12rpx;
					width: 112rpx;
					height: 36rpx;
					background-color: rgb(108, 133, 252);
				}

				.membershipCode {
					display: flex;
					flex-direction: column;
					align-items: center;

					.codeImage {
						margin-bottom: 8rpx;
						width: 32.02rpx;
						height: 31.16rpx;
					}
				}
			}
		}

		.conent {
			padding: 20rpx;

			.coreData {
				.line {
					width: 8rpx;
					height: 34rpx;
					background: rgb(108, 133, 252);
				}

				padding: 30rpx;
				width: 704rpx;
				height: 722rpx;
				border-radius: 20rpx;

				background: rgb(255, 255, 255);

				.dataStatistics {
					// padding:  22rpx;
					// width: 33.3%;

					.width33 {
						width: 33.3%;
					}

				}

			}

			.packageCardConfiguration {
				.line {
					width: 8rpx;
					height: 34rpx;
					background: rgb(108, 133, 252);
				}

				.avaterIcon {
					width: 72rpx;
					height: 72rpx;
					margin-bottom: 16rpx;
				}

				.infoBox {
					width: 25%;
					margin-bottom: 30rpx;
				}

				width: 706rpx;
				min-height: 262rpx;
				padding: 30rpx;
				border-radius: 20rpx;
				margin-top: 20rpx;
				background: rgb(255, 255, 255);
			}



			.selectTime {
				margin-top: 20rpx;

				.tab {

					list-style-type: none;
					margin-right: 20rpx;
					display: block;
					width: 108rpx;
					height: 50rpx;
					line-height: 50rpx;
					border-radius: 118rpx;
					border: 1px solid rgb(239, 239, 239);
					text-align: center;
					background: rgb(255, 255, 255);
					color: rgb(153, 153, 153);
				}

				.active {
					width: 108rpx;
					height: 50rpx;
					border-radius: 118rpx;
					background: rgb(108, 133, 252);
					color: rgb(255, 255, 255);
					;
					text-align: center;
					line-height: 50rpx;
				}

				.orderStatus {
					width: 90px;
					height: 50rpx;
					text-align: center;
					line-height: 50rpx;
					font-weight: 700;

				}




			}

		}



	}
</style>